const connection = require("../app/database");

class PremissionService {
  async checkMoment(momentId, user_id) {
    const statement = "SELECT * FROM moment WHERE id = ? AND user_id = ?;";
    const [result] = await connection.execute(statement, [momentId, user_id]);

    return !!result.length;
  }
}

module.exports = new PremissionService();
